// Interface for recieving model events
// Copyright 2004 (C) Ralph Thomas

#ifndef RECEIVER_H
#define RECEIVER_H

#include <string>

namespace model {
	class model;
	//
	/// The receiver interface should be implemented by classes which want
	/// to be notified when a model's attribute changes. The receiver
	/// interface also contains a mechanism for child event notification.
	//
	class receiver {
	  public:
		//
		// void notify( const model* m, string attrName )
		//
		/// Models invoke this function when an attribute which they
		/// have (except for the children attribute) changes. The model
		/// which changed, and the attribute which changed are given as
		/// parameters.
		///
		/// \param	m		the model which changed.
		/// \param	attrName	the name of the attribute which
		///				changed.
		//
		virtual void notify( const model* m, const std::string& attrName ) = 0;
	};
};

#endif

